package nl.hanze.designpatterns.Controllers;

import nl.hanze.designpatterns.Domain.Answer;
import nl.hanze.designpatterns.Domain.Question;
import nl.hanze.designpatterns.Models.MainModel;
import nl.hanze.designpatterns.Views.MainScreen;

/**
 * Created by Aron on 6-10-2014.
 */
public class QnAController {

    private MainModel mainModel;
    private MainScreen mainScreen;

    public QnAController(MainScreen mainScreen, MainModel mainModel) {
        this.mainScreen = mainScreen;
        this.mainModel = mainModel;
    }

    public void logout() {
        System.out.println("[LOGOUT]");
        this.mainModel.logout();
        mainScreen.changeView("login");
    }

    public void toTickets() {
        mainScreen.changeView("ticket");
    }

    public void selectQuestion(Question question) {
        System.out.println("[selectQuestion] "+question);
        mainModel.selectQuestion(question);
    }

    public void selectAnswer(Answer answer) {
        System.out.println("[selectAnswer] "+answer);
        mainModel.selectAnswer(answer);
    }
}
